<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>json数据展示 - 有错误</title>
</head>

<body>

  <!-- 在这里引入 JSON 文件 -->
  <script src="data.json"></script>

  <script>
    // 读取全局变量中的数据
    var name = myData.name;
    var age = myData.age;
    var email = myData.email;

    // 在页面上展示数据
    document.write("姓名：" + name + "<br>");
    document.write("年龄：" + age + "<br>");
    document.write("邮箱：" + email + "<br>");
  </script>

  


  
</body>

</html>